/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package combomodel.contas;

import eloma.classe.material.Material;
import eloma.classe.Meses;
import java.util.List;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;

/**
 *
 * @author icaro.klinger
 */
public class ComboBoxContasMesesModel extends AbstractListModel implements ComboBoxModel {

    private List<Meses> listaMeses;
    private Meses selection;

    public ComboBoxContasMesesModel(List<Meses> listaMeses) {
        this.listaMeses = listaMeses;
    }

    @Override
    public int getSize() {
        return listaMeses.size();
    }

    @Override
    public Object getElementAt(int index) {
        return listaMeses.get(index);
    }

    @Override
    public void setSelectedItem(Object anItem) {
        selection = (Meses) anItem;
    }

    @Override
    public Object getSelectedItem() {
        return selection;
    }

}
